package de.clapp.club;

import java.util.ArrayList;

import android.content.Loader;
import android.os.Bundle;
import de.clapp.BaseModel;
import de.clapp.data.Club;

public class ClublistModel extends BaseModel<ArrayList<Club>>
{
    private static final ClublistModel instance = new ClublistModel();

    public static ClublistModel getInstance()
    {
        return instance;
    }

    @Override
    public Loader<ArrayList<Club>> onCreateLoader(int id, Bundle args)
    {
        System.out.println("ClubModel.onCreateLoader()");
        return new ClubListLoader(activity);
    }

    
    /*
    @Override
    public void onLoadFinished(Loader<ArrayList<Club>> loader, ArrayList<Club> data)
    {
//        for (Club c : data)
//        {
//            if (c.getIpAddress() != null || c.getPort() != 0)
//            {
//                ClappModel.getInstance().setCurrentClub(c);
//            }
//        }
        activity.getLoaderManager().initLoader(ClappMain.LOADERNUMBER++, null, MenucardModel.getInstance()).forceLoad();
        super.onLoadFinished(loader, data);
        
    }*/

    public ArrayList<Club> getClubList()
    {
        return (ArrayList<Club>) modelData;
    }
}